home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: uu4news.netcom.com!telesoft!kst
- From: kst@thomsoft.com (Keith Thompson)
- Subject: Re: ANSI C and POSIX (was Re: C/C++ knocks the crap out of Ada)
- X-Nntp-Posting-Host: pulsar
- Message-ID: <Dponz7.2C4@thomsoft.com>
- Originator: kst@pulsar
- Sender: news@thomsoft.com (USENET News Admin @flash)
- Organization: Thomson Software Products, San Diego, CA, USA
- References: <dewar.828846122@schonberg> <828903511snz@genesis.demon.co.uk> <4kgjrc$4d@news.nyu.edu>
- Date: Thu, 11 Apr 1996 05:45:06 GMT
-
- I've trimmed the "Newsgroups:" line down to comp.lang.c.
-
- In <4kgjrc$4d@news.nyu.edu> halvin@acf4.nyu.edu (halvin) writes:
- [...]
- > this might be slightly off-topic, but isn't there a difference between the
- > ANSI and POSIX versions of fprintf? if i remember correctly, the ANSI version
- > returns 0 on success and EOF on failure -- but the POSIX version returns the
- > number of characters printed, or a negative number to indicate failure.
-
- No, the ANSI/ISO C standard says that fprintf returns "the number of
- characters transmitted, or a negative value if an output error occurred."
- (7.9.6.1). The POSIX specification is the same, at least according to the
- POSIX reference I have (I don't have a copy of the POSIX standard itself).
-
- Perhaps you're thinking of sprintf, which returns char* in some
- implementations; however, POSIX and ANSI/ISO agree that sprintf returns
- int.
-
- --
- Keith Thompson (The_Other_Keith) kst@thomsoft.com <*>
- TeleSoft^H^H^H^H^H^H^H^H Alsys^H^H^H^H^H Thomson Software Products
- 10251 Vista Sorrento Parkway, Suite 300, San Diego, CA, USA, 92121-2718
- This sig uses the word "Exon" in violation of the Communications Decency Act.
-